
<div style="height:auto; overflow:scroll;">
<table class="table table-bordered table-hover table-striped" style="width: 1500px;">
	<tbody>
		<!--编号、合同号、房间号、订单号、OPID、支付方式、费用类型、支付金额、支付时间、下载收据-->
		<tr align="center">
			<td><strong>No.</strong></td>
			<td><strong>客户</strong></td>
			<td><strong>合同号</strong></td>
			<td><strong>房号</strong></td>
			<td><strong>押金</strong></td>
			<td><strong>房租</strong></td>
			<td><strong>定金</strong></td>
			<td><strong>物业费</strong></td>
			<td><strong>水电气费</strong></td>
			<td><strong>房卡押金</strong></td>
			<td><strong>减免</strong></td>
			<td><strong>合计</strong></td>
			<td><strong>现金</strong></td>
			<td><strong>拉卡拉</strong></td>
			<td><strong>微信</strong></td>
			<td><strong>支付宝</strong></td>
			<td><strong>信用卡</strong></td>
			<td width="150"><strong>日期</strong></td>
			<td><strong>备注</strong></td>
			<td width="50"><strong>状态</strong></td>
			<td width="100"><strong>收据导出</strong></td>
			<td><strong>支付订单号</strong></td>
			<td><strong>管家</strong></td>
		</tr>
		<if condition="is_array($list) && count($list)" >
		<foreach name="list" item="ls">
			<tr align="center">
				<td>{$ls.id}</td>
				<td>{$ls.nickname}</td>
				<td>{$ls.contract}</td>
				<td>{$ls.roomnumber}</td>
				<td>{$ls.deposit}</td>
				<td>{$ls.rent}</td>
				<td>{$ls.deposit_first}</td>
				<td>{$ls.property}</td>
				<td>{$ls.water_power}</td>
				<td>{$ls.card_deposit}</td>
				<td><?php echo $ls['typeid'] == 3 ? $ls['other'] : '0.00'; ?></td>
				<td>{$ls.acount}</td>
				<td>{$ls.xianjin}</td>
				<td>{$ls.lakala}</td>
				<td>{$ls.weixin}</td>
				<td>{$ls.alipay}</td>
				<td>{$ls.band}</td>
				<td>{$ls.createtime|date="Y-m-d",###}</td>
				<td>{$ls.remark}</td>
				<td>
					<?php if($ls['visible']){ ?>
					<a href="javascript:void(0);" class="setstate" _gid="{$ls['id']}" _val="1" title="点击修改状态">有效</a>
					<?php }else{ ?>
					<a href="javascript:void(0);" class="setstate" _gid="{$ls['id']}" _val="0" title="点击修改状态">无效</a>
					<?php } ?>
				</td>
				<td>
					<?php if($ls['typeid'] == 1){ ?>
						<?php if($ls['deposit'] > 0){ ?>
						<a href="excelbill.html?id={$ls['id']}&type=1">押金</a> | 
						<?php } ?>
						<a href="excelbill.html?id={$ls['id']}&type=2">费用</a> 
					<?php } ?>
				</td>
				<td style="text-align:left" align="left">
					<?php if(!empty($ls['alipay_ordersn'])){ ?>
					支付宝：{$ls['alipay_ordersn']}&nbsp;&nbsp; {$ls['weixin_ordersn'] ? '<br />' : ''}
					<?php } if(!empty($ls['weixin_ordersn'])){ ?>
					微信：{$ls['weixin_ordersn']}
					<?php } ?>
				</td>
				<td>{$ls.admin_nick}</td>
			</tr>
		</foreach>
		<else />
			<tr align="center">
				<td colspan="25">暂无数据...</td>
			</tr>
		</if>
	</tbody>
</table>
</div>
<div class="pagination" style="float: right; widht: 95%">
	<include file="Common/page" />
</div>
<script>
	$(document).ready(function(){
		$("a.setstate").on('click', function(){
			var obj = $(this);
			var data = {};
				data.gid = obj.attr("_gid");
				data.state = obj.attr('_val')/1 == 1 ? 0 : 1;
			var showval = data.state/1 == 1 ? '有效' : '无效';
			
			$.post('index.html', data, function(row){
				if(row/1){
					layer.msg("修改成功", {icon: 1, time:2000}, function(){
						obj.attr('_val', data.state);
						obj.html(showval);
					});
				}else{
					layer.msg("修改失败",{icon: 2, time: 2000});
				}
			});
		});
	});
</script>